module.exports = app => { 
    const {STRING,DOUBLE} = app.Sequelize;

    const Xue = app.model.define('xue',{
        name:STRING,
        chengji:DOUBLE
    })

    Xue.associate = function() {
        //所属那个班级，指向那个班级的主键
        app.model.Xue.belongsTo(app.model.Clazz,{
            //定义外键
            foreignkey: 'clazz_id',
            //别名
            as: 'clazz'
        })
    }
    return Xue;
}
